package zl.jmail;

import java.util.Properties;

/**
 * @author  SuperZL 
 * @version 2012-9-3 上午10:29:16
 * 用户信息类
 */
public class MailSendInfo {

	private String mailServerHost;		//发送邮件的主机地址
	private String mailServerPort;		//发送邮件主机的端口
	private String fromAddress;			//发送者的地址
	private String toAddress;			//接收者的地址
	private String username;			//发送者的用户名
	private String password;			//发送者的密码
	private boolean isValidate;		//时候需要验证信息
	private String subject;				//发送邮件的主题
	private String content;				//发送邮件的内容
	private String[] attachFileNames;	//发送邮件的附件文件名数组
	
	public MailSendInfo() {
		super();
	}

	public MailSendInfo(String mailServerHost, String mailServerPort,
			String fromAddress, String toAddress, String username,
			String password, boolean isValidate, String subject,
			String content, String[] attachFileNames) {
		super();
		this.mailServerHost = mailServerHost;
		this.mailServerPort = mailServerPort;
		this.fromAddress = fromAddress;
		this.toAddress = toAddress;
		this.username = username;
		this.password = password;
		this.isValidate = isValidate;
		this.subject = subject;
		this.content = content;
		this.attachFileNames = attachFileNames;
	}

	public String getMailServerHost() {
		return mailServerHost;
	}

	public void setMailServerHost(String mailServerHost) {
		this.mailServerHost = mailServerHost;
	}

	public String getMailServerPort() {
		return mailServerPort;
	}

	public void setMailServerPort(String mailServerPort) {
		this.mailServerPort = mailServerPort;
	}

	public String getFromAddress() {
		return fromAddress;
	}

	public void setFromAddress(String fromAddress) {
		this.fromAddress = fromAddress;
	}

	public String getToAddress() {
		return toAddress;
	}

	public void setToAddress(String toAddress) {
		this.toAddress = toAddress;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public boolean isValidate() {
		return isValidate;
	}

	public void setValidate(boolean isValidate) {
		this.isValidate = isValidate;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String[] getAttachFileNames() {
		return attachFileNames;
	}

	public void setAttachFileNames(String[] attachFileNames) {
		this.attachFileNames = attachFileNames;
	}

	/**
	 * @return
	 * 返回封装好的属性
	 */
	public Properties getProperties(){
		Properties  properties = new Properties();
		properties.put("mail.smtp.host", this.mailServerHost);
		properties.put("mail.smtp.port", this.mailServerPort);
		properties.put("mail.smtp.auth", this.isValidate ? "true" : "false");
		return properties;
	}
}
 